<HTML><HEAD><TITLE>viewable_create(?ViewableName, +Elements)</TITLE>
</HEAD><BODY>[ <A HREF="index.html">library(viewable)</A> | <A HREF="../../index.html">Reference Manual</A> | <A HREF="../../fullindex.html">Alphabetic Index</A> ]
<H1>viewable_create(?ViewableName, +Elements)</H1>
Create a viewable.
<DL>
<DT><EM>ViewableName</EM></DT>
<DD>A string or atom; the name of the new viewable.
</DD>
<DT><EM>Elements</EM></DT>
<DD>A possibly nested list or array (as created for example by dim/2).
</DD>
</DL>
<H2>Description</H2>


        <p><B>NOTE:</B>When there are no registered visualisation clients,
        this predicate succeeds with any arguments, and has no effect.</P>

	This predicate creates a new viewable by specifying its name and
	elements. The predicate will try to guess the number of dimensions
	for the new viewable from the level of nesting in
	<em>Elements</em>. All dimensions are set to <code>fixed</code> so
	they cannot be expanded later. The element type is set to
	<code>any</code>. For more control over the number and fixity of
	dimensions and the element type, use
	<code>viewable_create/3</code>.

        In other ways the predicate behaves just like
        <code>viewable_create/3</code>. See the documentation for that
        predicate for more details. </P>
<H3>Resatisfiable</H3>
no
<H3>Exceptions</H3>
<DL>
<DT><EM>(4) instantiation fault </EM>
<DD>ViewableName is not an atom, string or free variable.
<DT><EM>(1) general error </EM>
<DD>ViewableName is the name of an existent viewable.
<DT><EM>(1) general error </EM>
<DD>Elements is not a nested list or array.
</DL>
<H2>Examples</H2>
<PRE>

[Assuming that at least one visualisation client is registered]

       Success:

       viewable_create(viewable1, [X, Y, Z]).

       viewable_create("viewable1", [](X, Y, Z)).

       viewable_create(m, []).

       viewable_create(var23, [[],[],[]]).

       viewable_create(var315, []([]([](R, T, [E, X, Y]), 
                                     [](W, T, grok(D))), 
				  []([](A, B, C),
				     [](R, E, W)))).



       Exceptions raised:

       viewable_create(2, [x,y,z]).
       [gives error 4] 

       viewable_create(v1, [x,y,z]), 
       viewable_create(v1, [x,y,z]).
       [gives error 1] 

       viewable_create(v1, _).
       [gives error 1] 


				    </PRE>
<H2>See Also</H2>
<A HREF="../../lib/viewable/viewable_create-3.html">viewable_create / 3</A>, <A HREF="../../lib/viewable/viewable_expand-3.html">viewable_expand / 3</A>
</BODY></HTML>
